package Huihu.src.天梯赛;

import java.util.Scanner;

public class 斯德哥尔摩火车上的题 {
    public static void main(String[] args) {//112233588
        Scanner scanner = new Scanner(System.in);
        String string1 = scanner.nextLine();
        String string2 = scanner.nextLine();
        String str1 = "";
        String str2 = "";
        if (string1.length() <= 10000) {
            for (int i = 1; i < string1.length(); i++) {
                if ((string1.charAt(i) - '0') % 2 == (string1.charAt(i - 1) - '0') % 2) {
                    if (string1.charAt(i) - '0' >= string1.charAt(i - 1) - '0') {
                        str1 += string1.charAt(i);
                    } else {
                        str1 += string1.charAt(i - 1);
                    }
                }
            }
        }

        if (string2.length() <= 10000) {
            for (int i = 1; i < string2.length(); i++) {
                if ((string2.charAt(i) - '0') % 2 == (string2.charAt(i - 1) - '0') % 2) {
                    if (string2.charAt(i) - '0' >= string2.charAt(i - 1) - '0') {
                        str2 += string2.charAt(i);
                    } else {
                        str2 += string2.charAt(i - 1);
                    }
                }
            }
        }
        if (str1.equals(str2)){
            System.out.println(str2);
        }
        else {
            System.out.println(str1);
            System.out.println(str2);
        }
    }
}
